package com.jk.admin.controller;


import com.jk.admin.entity.Coupon;
import com.jk.admin.service.CouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("coupon")
public class CouponController {

    @Autowired
    private CouponService couponService;

    @RequestMapping("queryCoupon")
    public List<Coupon> queryCoupon(){
        List<Coupon> list = couponService.query();
        return list;
    }

    @RequestMapping("deleteCoupon")
    public void deleteCoupon(String id){
        couponService.delete(id);
    }

    @RequestMapping("overdueCoupon")
    public void overdueCoupon(String id){
        couponService.overdueCoupon(id);
    }

    @RequestMapping("insertCoupon")
    public void insertCoupon(Coupon coupon){
        couponService.insertCoupon(coupon);
    }




}
